package com.sinochem.sales.workflow.actlistener;

import com.sinochem.sales.workflow.entity.UserLeave;
import org.activiti.engine.delegate.DelegateTask;

import java.util.Map;

/**
 * @author xuan😴🐶🐱🐽🌺  <a href="zhangshixuanj@163.com">联系作者</a>
 * @version Revision:v1.0,Date: 2018/5/7 18:05
 * @project auth
 * @description自定义请假流程 监听器
 * @Modification Date: 2018/5/7 18:05  {填写修改说明}
 */
public class LeaveListenerImpl extends NodeListener {

    @Override
    public void notify(DelegateTask delegateTask) {
        super.notify(delegateTask);
        String taskId = delegateTask.getId();
        Map<String, Object> map = delegateTask.getVariables();
        UserLeave userLeave = (UserLeave) map.get("userLeave");
        delegateTask.addCandidateUser(userLeave.getUserId());
    }
}
